package cn.bupt.sse309.ydl.activity;

import cn.bupt.sse309.ydl.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class ResetPasswordActivity extends Activity implements OnClickListener {

  private Button finishBtn, backBtn;
  private EditText newPasswordEt, confirmPasswordEt;
  private TextView titleTv;
  private String passwordStr;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    this.setContentView(R.layout.activity_reset_password);
    this.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.base_title_with_back);
    this.initView();
  }

  /**
   *
   */
  public void initView() {
    // TODO Auto-generated method stub
    this.finishBtn=(Button) this.findViewById(R.id.btn_finish);
    this.backBtn=(Button) this.findViewById(R.id.baseBack);
    this.newPasswordEt=(EditText) this.findViewById(R.id.et_new_password);
    this.confirmPasswordEt=(EditText) this.findViewById(R.id.et_confirm_password);
    this.titleTv=(TextView) this.findViewById(R.id.baseTitleId);
    this.titleTv.setText(R.string.title_reset_passw);
    this.finishBtn.setOnClickListener(this);
    this.backBtn.setOnClickListener(this);


  }

  /* (non-Javadoc)
   * @see android.view.View.OnClickListener#onClick(android.view.View)
   */
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
    case R.id.baseBack:
 ResetPasswordActivity.this.finish();
      break;

 case R.id.btn_finish:
   ResetPasswordActivity.this.passwordStr = ResetPasswordActivity.this.newPasswordEt.getText()
   .toString();
   if (ResetPasswordActivity.this.passwordStr.length() <= 0) {
     Toast.makeText(this, "电话不能为空", 1).show();
     return;
   }

      break;
    default:
      break;
    }

  }
}
